﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
namespace CheatService
{
    /// <summary>
    /// Summary description for Message
    /// </summary>
    [DataContract]
    public class Message
    {
        [DataMember]
        public string From { get; private set; }
        [DataMember]
        public string To { get; private set; }
        [DataMember]
        public string Body { get; private set; }
        public DateTime CreateTime { get; private set; }
        public string Key { get; private set; }
        public Message(string message)
        {
            string[] messagefileds = message.Split(new char[] { '&', '=' });
            From = messagefileds[1];
            To = messagefileds[3];
            Body = messagefileds[5];
            CreateTime = DateTime.Now;
            Key = Guid.NewGuid().ToString();
        }
    }
}